<template>
	<view class="content">
		<tui-button type="warning" @click="goRequest">康康请求</tui-button>
		<view class="theme-text">
			{{result}}
		</view>
		<transition :typeList="typeList" :isContentShow="showTranstions">
			<view class="total-card t-p-30">
				我是飞出来的哦
			</view>
		</transition>
		
		<tui-button @click="showTranstions = !showTranstions">康康交互</tui-button>
	</view>
</template>

<script>
		import Transition from "@/components/transition/transition.vue"
	export default {
		data() {
			return {
				title: 'Hello',
				modal: false,
				result:'',
				showTranstions: false,
				typeList: ['fade', 'slide-up'],
			}
		},
		components: {
			Transition
		},
		onLoad() {
			
		},
		methods: {
			goRequest(type) {
				let postData = {}
				this.tui.request("/Home/GetStatus", "GET", postData, false, true, type == 1 ? false : true).then((res) => {
					if (res.code == 100) {
						this.result = `${type == 1 ?"带":"无"}loading请求成功！返回值为 ${JSON.stringify(res)}`
					} else {
						this.result = `${type == 1 ? "带" : "无"}loading请求失败！ ${JSON.stringify(res)}`
					}
				}).catch((res) => {
					this.result = `${type == 1 ? "带" : "无"}loading请求失败！ ${JSON.stringify(res)}`
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.total-card{
		background: #fff;
	}
</style>
